#!/bin/bash
set -e

BUILD_DIR=build

java -cp antlr-3.1.2.jar org.antlr.Tool -o build VPL.g
touch build/__init__.py

if [ ${#} -ne 1 ]; then
	exit 0
fi

./pymain.py  vpls/${1} tree
./pymain.py  vpls/${1} compile > ${1}.s

echo "compiled ${1} into ${1}.s. linking..."

gcc -Wall -W -g main.c ${1}.s -o my_program
